package com.eclecticconceptions.vulcan;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TextView;

public class Cp12Activity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        setContentView(R.layout.main);
        
        TabHost tabHost = getTabHost();  // The activity TabHost
        
        
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab
        
        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, TightnessActivity.class);
        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("tightness").setIndicator("Let-By & \nTightness")
                      .setContent(intent);
        tabHost.addTab(spec);

        // Do the same for the other tabs
        intent = new Intent().setClass(this, ImperialRatesActivity.class);
        spec = tabHost.newTabSpec("imperialgasrates").setIndicator("Imperial \nGas Rates")
                      .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, MetricRatesActivity.class);
        spec = tabHost.newTabSpec("metricgasrates").setIndicator("Metric \nGas Rates")
                      .setContent(intent);
        tabHost.addTab(spec);
        
        for(int x=0;x<3;x++){
        TextView title = (TextView) tabHost.getTabWidget().getChildAt(x)
        		.findViewById(android.R.id.title);
        title.setSingleLine(false);
        //tabHost.getTabWidget().getChildAt(x).getLayoutParams().height =(int) 20;
       
        }

        
        tabHost.setCurrentTab(0);
    }
 
    
    
}